package com.qdlc.p2p.dal.dao;

import com.qdlc.p2p.dal.common.dao.BaseDao;
import com.qdlc.p2p.dal.common.model.jpa.PageDataList;
import com.qdlc.p2p.dal.dto.Operator;
import com.qdlc.p2p.dal.dto.UserIdentify;
import com.qdlc.p2p.dal.model.UserIdentifyModel;
import com.qdlc.p2p.dal.model.UserModel;
import com.qdlc.p2p.dal.model.UserVipApplyModel;

/**
 * 认证信息
 * 
 * @author sj
 * @version 2.0
 * @since 2014年2月17日17:27:02
 */
public interface UserIdentifyDao extends BaseDao<UserIdentify> {

	/**
	 * 
	 * @param userId
	 * @return
	 */
	UserIdentify findByUserId(long userId);

	/**
	 * 更新实名认证状态real_name_status
	 * 
	 * @param userId
	 */
	void modifyRealnameStatus(long userId, int status, int preStatus);
	/**
     * 更新实名认证状态real_name_status
     * 
     * @param userId
     */
    void modifyRealnameStatus(long userId, int status);

	/**
	 * 更新邮箱激活状态email_status
	 * 
	 * @param userId
	 */
	void modifyEmailStatus(long userId, int status, int preStatus);

	/**
	 * 更新手机绑定状态mobile_phone_status
	 * 
	 * @param userId
	 */
	void modifyMobilePhoneStatus(long userId, int status, int preStatus);
	/**
     * 更新手机绑定状态mobile_phone_status
     * 
     * @param userId
     */
    void modifyMobilePhoneStatus(long userId, int status);

    /**
	 * 更改vip状态
	 * @param userId
	 * @param status
	 * @param preStatus
	 */
	void modifyVipStatus(long userId, int status, int preStatus);
    
	/**
	 * 审核用户认证信息
	 * 
	 * @param id
	 * @param userId
	 * @param realNameVerifyRemark
	 * @param realNameStatus
	 * @param user
	 */
	void userAttestationEdit(long id, long userId, String realNameVerifyRemark, int realNameStatus, Operator operator);

	/**
	 * 根据实名认证状态统计总数
	 * 
	 * @param status
	 * @return
	 */
	int countByRealName(int status);

	/**
	 * 根据手机号计数 注意:已经手机认证的用户
	 * 
	 * @param mobilePhone
	 * @return
	 */
	int countByMobilePhone(String mobilePhone);

	/**
	 * 统计邮箱：已经认证的用户
	 * 
	 * @param email
	 * @return
	 */
	int countByEmail(String email);

	public PageDataList<UserIdentifyModel> findUserIdentifylist(UserIdentifyModel model);

	public PageDataList<UserIdentifyModel> findUserIdentifylist(int pageNumber, int pageSize, UserIdentify model, String searchName);
	
	public PageDataList<UserModel> userModelList(int pageNumber, int pageSize, UserIdentify model, String searchName);
	
	public PageDataList<UserModel> userModelList(UserIdentifyModel model);
	
	public PageDataList<UserVipApplyModel> vipApplyList(int pageNumber, int pageSize, UserVipApplyModel model);

    /**
	 * 更改绑定认证信息状态
	 * @param userId
	 * @param status
	 * @param preStatus
	 */
	void modifyTppMobilePhoneStatus(long userId, int status, int preStatus);
}
